FROM ethereum/client-go

COPY net-intelligence/eth-net-intelligence-api/ /root/eth-net-intelligence-api/

RUN apk add --update bash nodejs nodejs-npm perl && \
    npm install -g cnpm --registry=https://registry.npm.taobao.org

RUN cd /root/eth-net-intelligence-api &&\
    cnpm install &&\
    cnpm install -g pm2

ADD start.sh /root/start.sh
ADD net-intelligence/app.json /root/eth-net-intelligence-api/app.json
RUN chmod +x /root/start.sh

ENTRYPOINT /root/start.sh
